<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Flex 布局模板</title>
    <style>
        /* 父容器样式区域 */
        .container {
            /* vh 是视口单位，1vh = 视口高度的1%           */
            height: 100vh;
            background-color: palevioletred;
            padding-top: 10px;
            box-sizing: border-box;
            /* 弹性布局 */
            display: flex;

        }

        .container div {
            width: 100px;
            height: 100px;
            background: #4CAF50;
            color: white;
            padding: 20px;
            border: 1px solid black;
            /* 两端对齐 */
            justify-content: space-between;
            /* 均分对齐 */
            /* justify-content: space-evenly; */

            /* 交叉轴对齐方式 */
            align-items: flex-end;

        }

        .item {
            /* flex:1 将剩余尺寸分为 1 份，他占 1 份 */
            flex: 1;
        }

        .item2 {
            /* 单个子元素设置对齐 */
            align-self: center;
            flex: 1;

        }

        .item3 {
            align-self: flex-end;
            flex: 2
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="item">项目1</div>
        <div class="item2">项目2</div>
        <div class="item3">项目3</div>
    </div>
</body>

</html>